import { handleActions } from "redux-actions";
import { GET_ALL_NAVS } from "../types";
import _ from "lodash";

const initData = {
  rows: [],
};

export const navs = handleActions(
  {
    [GET_ALL_NAVS]: (state, { payload }) => {
      const { rows } = payload;
      return _.assign({}, state, { rows });
    },
  },
  initData
);
